<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">
        <div style="background-color: red;width: 100px;height: 100px;"v-if="a%2===1"></div>
        <button @click="a++">点击</button>

    </div>
    
</body>
<script src="./vue.js"></script>
<script>
    const {createApp,ref} = Vue;
createApp({

    setup(){
        let a = ref(0);
        return{
            a
    }
    }
   
}).mount('#box')

</script>
</html>